function A=invvec(g);
[m,n]=size(g);
k=round(sqrt(m));

for i=1:k
    for j=1:k
        A(i,j)=g((i-1)*k+j);
    end
end
A=A.';